$(function () {
    $("#top").load("/html/top.html");
    $("#foot").load("/html/foot.html");
    $("#page").load("/html/page.html");
    findAll();
})

function findAll() {
    let data = myAjax("/home", 'get', {})
    console.log(data);
    setNewsHtml(data.newsModelList);
}


function setNewsHtml(data) {
    let html = '';
    for (let i = 0; i < data.length; i++) {
        html += ' <div>\n' +
            '                        <div>' + data[i].title + '</div>\n' +
            '                        <div>' + data[i].content + '</div>\n' +
            '                    </div>';
    }
    $("#newsHtml").html(html);
}

